package com.wealth.trade.web.controller;

import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.wealth.order.entity.OrderPlat;
import com.wealth.order.service.IOrderPlatService;
import com.wealth.system.web.controller.BaseController;

/**
 * 订单
 * @author CHAN
 */
@Controller
@RequestMapping(value="/manage/order")
public class OrderController extends BaseController{

	Logger logger = Logger.getLogger(OrderController.class);
	
	@Autowired
	private IOrderPlatService orderPlatService;
	
	/**
	 * 订单支付页面
	 */
	@RequestMapping(value="/pay/{orderId}",method = RequestMethod.GET)
	public String pay(HttpServletRequest request,@PathVariable Long orderId) throws Exception{
		try { 
			OrderPlat orderPlat = orderPlatService.get(orderId);
			request.setAttribute("orderId", orderId); 
			request.setAttribute("orderPlat", orderPlat);
			request.setAttribute("flag", "myoder");
			return "order/pay";
		} catch (Exception e) {
			logger.error("订单支付页面", e);
			return "system/500";
		}
	}
}


